<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="ipt">
</body>
</html>
<script>
    //函数去抖是一种心态
    //如果函数重复执行，那么就清空计时重新记录；
    var conut =0
    var t=null
    document.getElementById("ipt").oninput =function(){
        clearInterval(t);
        t =setTimeout(function(){
            console.log("执行");

        },500)
    }
</script>
